<?php
namespace fast;


class Redis
{
    private static $connections = [];

    public static function init($alias="default") {
        if (!array_key_exists($alias, self::$connections)) {
            $cache = new \Redis();
            $cache->connect('127.0.0.1', 6379, 1);
            $cache->auth('hongsiadmin');
            $cache->select(1);
            self::$connections[$alias] = $cache;
        }


        return self::$connections[$alias];
    }
}